﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Shell;
using System.Windows;
using System.Windows.Media;
using Cheems.Control.Extensions;

namespace Cheems.Control.Properties
{
    public static class WindowProperties
    {
        /// <summary>
        /// 窗体圆角
        /// </summary>
        public static readonly DependencyProperty CornerRadiusProperty =
            DependencyProperty.RegisterAttached(
                "CornerRadius",
                typeof(CornerRadius),
                typeof(WindowProperties),
                new PropertyMetadata(new CornerRadius(0)));


        public static void SetCornerRadius(DependencyObject element, CornerRadius value)
        {
            element.SetValue(CornerRadiusProperty, value);
        }

        public static CornerRadius GetCornerRadius(DependencyObject element)
        {
            return (CornerRadius)element.GetValue(CornerRadiusProperty);
        }


        /// <summary>
        /// 窗体颜色
        /// </summary>
        public static readonly DependencyProperty WindowColorProperty =
            DependencyProperty.RegisterAttached(
                "WindowColor",
                typeof(SolidColorBrush),
                typeof(WindowProperties),
                new PropertyMetadata(new SolidColorBrush(Color.FromArgb(0xFF,0x00,0x78,0xD4)))); // 默认蓝色

        public static void SetWindowColor(DependencyObject element, SolidColorBrush value)
        {
            element.SetValue(WindowColorProperty, value);
        }

        public static SolidColorBrush GetWindowColor(DependencyObject element)
        {
            return (SolidColorBrush)element.GetValue(WindowColorProperty);
        }


        // 窗体字体颜色
        public static readonly DependencyProperty TitleColorProperty =
            DependencyProperty.RegisterAttached(
                "TitleColor",
                typeof(SolidColorBrush),
                typeof(WindowProperties),
                new PropertyMetadata(Brushes.White));

        // 设置 TitleColor
        public static void SetTitleColor(DependencyObject element, SolidColorBrush value)
        {
            element.SetValue(TitleColorProperty, value);
        }

        // 获取 TitleColor
        public static SolidColorBrush GetTitleColor(DependencyObject element)
        {
            return (SolidColorBrush)element.GetValue(TitleColorProperty);
        }
    }

}
